<?php
//include('../lib/log4php/Logger.php');
//Logger::configure('../log/logconfig.xml');
//include '../util/PrintArray.php';

include 'LoginInterface.php';
include '../dataservice/UserLoginImplement.php';

class LoginImplement implements LoginInterface {
    
    private $log;
    public function __construct(){
       $this->log = Logger::getLogger(__CLASS__); 
    }
    
    public function login($loginRequest) {
        $printArray = new PrintArray();
        $this->log->info($printArray->printArrayMultilineStyle($loginRequest));
        $loginService = new UserLoginImplement();
        $userId = $loginRequest['loginRequestDetail']['username'];
        $password = $loginRequest['loginRequestDetail']['password'];
        return $loginService->userLogin($userId, $password);
    }
}
?>
